package com.yuxiu.edu.web.controller.base;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public abstract class BaseController<T> {

    public static String MANAGE_PAGE;
    public static String INFO_PAGE;
    public static String EDIT_PAGE;

    public static final String MANAGE="manage";
    public static final String INFO="info";
    public static final String EDIT="edit";


    public BaseController() {

        ParameterizedType type= (ParameterizedType) this.getClass().getGenericSuperclass();

        Class<?> modelClass= (Class<?>) type.getActualTypeArguments()[0];

        String modelName=modelClass.getSimpleName().toLowerCase();

        MANAGE_PAGE=modelName+"/"+MANAGE;
        INFO_PAGE=modelName+"/"+INFO;
        EDIT_PAGE=modelName+"/"+EDIT;
    }






}
